<template>
	<view>
		<view class="content">
			<view>
				<image src="../../static/image/page/logo@3x.png" class="logo"></image>
				<image src="../../static/image/page/dtg-text-img.png" class="dtg-text-img"></image>
			</view>
			<button class="btn" @click="wxLogin">微信登录</button>
			<!-- <button wx:else open-type="getPhoneNumber" bindgetphonenumber="getPhoneNumber" class="btn">微信登录</button> -->
			<navigator url="/pages/login/index" class="btn zh-btn">账号登录</navigator>

		</view>

	</view>
</template>

<script>
	export default {
		data() {
			return {

			}
		},
		methods: {
			//微信登录
			wxLogin() {
				var that = this;
				uni.getProvider({
					service: 'oauth',
					success: function(res) {
						console.log(res.provider)
						if (~res.provider.indexOf('weixin')) {
							uni.login({
								provider: 'weixin',
								success: function(loginRes) {
									console.log(JSON.stringify(loginRes));
								}
							});
						}
					}
				});
			},
		},
	}
</script>

<style scoped>
	page {
		background-color: #fff;
	}

	.content {
		display: flex;
		align-items: center;
		justify-content: center;
		flex-direction: column;
		height: calc(100vh - var(--status-bar-height));
	}

	.logo {
		width: 134rpx;
		height: 134rpx;
		margin-bottom: 32rpx;
	}

	.dtg-text-img {
		width: 122rpx;
		height: 32rpx;
		display: block;
		margin-bottom: 250rpx;
	}

	.btn {
		width: 610rpx;
		height: 88rpx;
		background: #585CF7;
		border-radius: 44rpx;
		font-size: 32rpx;
		font-weight: bold;
		color: #FFFFFF;
		line-height: 88rpx;
		text-align: center;
		margin-bottom: 30rpx;
	}

	.zh-btn {
		background: #F8F8F8;
		color: #A7A7A7;
	}
</style>
